package com.maduar.mybatis.demo.mapstruct;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.maduar.mybatis.demo.vo.PageResultRet;
import com.maduar.mybatis.demo.vo.UserPageRes;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.springframework.stereotype.Component;

/**
 * Description:
 *
 * @author maduar maduar@163.com
 * @date 2021-04-11 01:09
 */
@Mapper(componentModel = "spring", unmappedSourcePolicy = ReportingPolicy.IGNORE)
@Component
public interface PageMapper {

    @Mapping(source = "records", target = "list")
    PageResultRet<UserPageRes> userPageToRes(IPage<UserPageRes> page);
}
